//@author A0096723X
#include "BotException.h"

const char* BotException::STRING_INVALID_INDEX = "INVALID INDEX!";
const char* BotException::STRING_INVALID_EMPTY = 	"EMPTY";
const char* BotException::STRING_INVALID_FORMAT = 	"INVALID FORMAT!";
const char* BotException::STRING_INVALID_DATE = 	"INVALID DATE!";
const char* BotException::STRING_INVALID_TIME = 	"INVALID TIME!";
const char* BotException::STRING_INVALID_ATTRIBUTE = 	"INVALID ATTRIBUTE";
const char* BotException::STRING_INVALID_UNDO = 	"INVALID UNDO";
const char* BotException::STRING_INVALID_REDO = 	"INVALID REDO";
const char* BotException::STRING_INVALID_COMMAND = 	"INVALID COMMAND";
const char* BotException::STRING_INVALID_NAME = 	"INVALID NAME";
const char* BotException::STRING_INVALID_START_AFTER_END = 	"START TIME AFTER END TIME";
const char* BotException::STRING_INVALID_UNKNOWN = 	"UNKNOWN EXCEPTION";

BotException::BotException(EXCEPTION_TYPE except): _exceptionType(except)
{
}


BotException::~BotException(void)
{
}

const char* BotException::what() const throw() {
	switch(_exceptionType) {
	case EXCEPTION_INVALID_INDEX:
		return STRING_INVALID_INDEX;
		break;
	case EXCEPTION_FORMAT_INVALID:
		return STRING_INVALID_FORMAT;
		break;
	case EXCEPTION_DATE_INVALID:
		return STRING_INVALID_DATE;
		break;
	case EXCEPTION_TIME_INVALID:
		return STRING_INVALID_TIME;
		break;
	case EXCEPTION_ATTRIBUTE_INVALID:
		return STRING_INVALID_ATTRIBUTE;
		break;
	case EXCEPTION_UNDO_INVALID:
		return STRING_INVALID_UNDO;
		break;
	case EXCEPTION_REDO_INVALID:
		return STRING_INVALID_REDO;
		break;
	case EXCEPTION_COMMAND_INVALID:
		return STRING_INVALID_COMMAND;
		break;
	case EXCEPTION_NAME_INVALID:
		return STRING_INVALID_NAME;
		break;
	case EXCEPTION_START_END_CONFLICT:
		return STRING_INVALID_START_AFTER_END;
		break;
	default:
		return STRING_INVALID_UNKNOWN;
	}
}
